You can still code, but you'll usually need a "Director" or "VP" title (increasingly, you see Directors and VPs without reports, perhaps as organizations realize they actually need experienced people) after 40, because you're going to know (one hopes) how to do things right and be infuriated if you don't have the organizational credibility to do things properly.
The technical skills that non-techs evaluate us on are the constantly changing, coarse familiarities, and the PYTs they listen to are going to be similarly biased in favor of hot new flavors. This isn't a meritocracy because, in truth, it's only easy for a good person to prove he's good through technical work if he either (a) controls the tech stack, or (b) selects a company with a tech stack he's already well-matched with. The problem with (b) is that companies are always changing their tech stack (hence, the zillion pointless flamewars). Otherwise you have to get some other, more legible, credibility (the "X") and transfer it over to technical decisions.
I'm aging in reverse. I was a cripple in my early-mid 20s (cyclothymia) and at 30, I'm probably healthier and more energetic than average for my age. I still have cyclo, but it's managed and I lose less time/health/energy to it than the average "bro" loses to alcoholism/hangovers. Because of the cyclo, I can achieve an incredible amount in a short-term job (say, 2 months) but the superficial reliability that most organizations care about is not my strong suit. So I've seen a lot. No one would call me "old" but I definitely know what it feels like to be "overexperienced". It sucks.