Shouldn't it be about a decade between the two films?
Kirk is 34 in The Deadly Years
. If we assume that is year two of the five-year mission, it means they finished up somewhere around the time he is 37. He hadn't logged a single star-hour in 2.5 years in TMP which would push him close to 40. In TWoK, it seems the intent is that he's celebrating his 50th birthday.