I took on my last tech job at age 61. I was titled a manager, but as ever before, I could not (would not) keep my hands away from coding. I was in a start-up company involved in a completely different line of work than I had done before. I had learned a lot about XML in my previous job, and in the last one I learned VXML and Perl. And developed my first Eclipse plug-in. My coding experience went back to the old days when every computer architecture was different, there were no "platforms", and all code was developed from scratch. Memory dumps were our friends in the old days.
I did sense that programming technologies were changing rapidly, and I managed to keep my hand in with all the 20-something coworkers by working very hard to study and learn and apply new things. It can be done.
Too often, I see folks debating the merits of various languages. During my career I learned a zillion of them. Not a big deal. The big deal is learning the concepts. Sometimes a particular language will embody a concept (such as objects) more clearly or more usefully than another. But once you grasp the concept, the rest is syntax. Once I was searching for a new job and an HR type rejected me because my CV did not show Visual Basic. When I did get a job a few weeks later, one of my first activities was helping a junior programmer develop some Visual Basic code. Although I had never seen Visual Basic code before, I became the "expert" because I could see the ideas and concepts beyond the syntax.
33, 40 is not "old". I am 70 now, and still get a kick out of reading /.