The attribution to Plato was invented in the 2000s, but the proverb itself is older. It seems to be originally a Scottish folk proverb. Its first appearance is in James Kelly's 1721 Complete Collection of Scottish Proverbs Explained and Made Intelligible to the English Reader, p. 322: there it's given in the form
Two things a man ſhould never be angry at; what he can help, and what he cannot help.
If he can help it, let him; if he cannot, Anger is to no purpoſe.
It also gets used in an 1830 novel written by - oh, you'll love this - John Galt. Not Ayn Rand's fantasy fulfilment character, though, but a Scottish novelist. The novel's called Lawrie Todd.