Spock met Kirk when he (Kirk) assumed command of the Enterprise
. Kirk was in his early thirties between 30-34 (another subject for another discussion). He would have had access to Kirk's record and Spock has excellent memory recall. He would know exactly what Kirk would look like. If kirk looked noticeably younger (to Spock's eyes) he would know he couldn't have been in command of the Enterprise
And while this is out of universe photos of Shatner a mere five or so years before Star Trek
show a noticeable difference even to human eyes.