The idiom Tongue-in-cheek is about a statement that is funny or sarcastic. It isn't meant to be taken seriously.
The phrase first meant contempt. By 1842, it got its modern meaning. Early users of the phrase include Sir Walter Scott in his 1828 The Fair Maid of Perth.