The original version was "you cannot eat your cake and have it too." John Heywood's Proverbs had that version back in 1584, which means that if it was published then, it was around for even longer than that. Incidentally, Heywood published it as "Wolde you bothe eate your cake, and haue your cake?"