One person who works on my team is in their mid 60’s, they are one of the best people in my team.
Now, what did he do to keep up with technology and programming? Well, he was a bright guy and he read computer magazines, studied the technology, came into work early, left late, and would have used viagra if it'd been available ~ if he'd needed it.
One day he decided he needed to learn C ~ before C was popular ~ and he did. Then C+, then "object oriented programming", then a background program you needed to know to manage the overhyped relational data base programming systems, and so on.
He just kept learning this stuff and staying ahead, and they kept him around because he was AHEAD of the curve, not because he was good. After all as you get older you start making mistakes, and that trend continues as your vision deteriorates, but if you stay ahead, "they" don't know about your mistakes.