55 here developing since 13. Recently dropped lead from my role and just became a developer again. I gained so much joy from not having to deal with most of the company stuff and just concentrating on the things I truly enjoy: creating, designing, troubleshooting, teaching, learning. I burnt out trying to do that and being the communication window through which the company and my team worked.
As long as you forever enjoy learning (oddly enough which you do through continually learning), you can stay current enough. If you keep somewhat current, have a strong work ethic and continually contribute to both your team and your company and make a good relationship with your manager (sadly, very important to happiness, stress, success & growth in your current company), you'll avoid a lot of ageism. And the older you get, the more important it becomes to stay healthy in order to keep your brain working as well as it can.