I think it depends on the person. I'm in my early 30s and I've already seen a pretty drastic decline in how quickly I can learn things. It would be tough but not impossible.
I became an expert in a Filenet based system. After 5 years they wouldn't promote me even though I had filled the role of a tech lead for a year and senior dev for a year. The company decided to outsource my role, so I transitioned to a NeoXam team. I worked on the Neoxam based system for almost 2 years and they basically pushed me out by giving me a low bonus and a BS reason (they were cutting the program headcount 50% the next year). Now I'm starting all over on a new stack - AWS, Java, Python, and a ton of related technologies.
Were you actively trying to keep brain in shape ? As a medic (neurology is not my field though) I am interested if it is possible to keep brain in shape by "mind exercises" or it is urban myth.
I wasn't doing any specific mental exercises. Like many software dev's, I don't get the most exercise, but I do get some. I have a decent diet and I'm pretty much in-shape.
PubMed might be a good place to research this. I believe believe diet and pyshical exercise are widely known to promote brain health. There are other things like mental exercises or nootropics studied too.