yes it does get harder to find "jobs" because you're way overqualified for most of them
by age 40, i had solid experience in a dozen different industries, mastered a half-dozen programming languages, built tools for developers and shrink-wrap boxed software and could claim (and prove) full-time professional experience spanning over 20 years - almost all of it on the cutting edge or "close to it".
You will not find this kind of depth and breadth of experience in 20-somethings or 30-somethings. And it does not come cheap ;-)
I try to stay moderately current, but primarily practice learn-to-earn; shiny new toys are not the attractive time-wasting distraction they used to be. It helps to communicate well, know how to lead and how to be a team player, and to generally be helpful and likable ;-)
Stand proud if you're still writing code at 40 (and beyond).
Note: at 42 I had "had enough of jobs" and started my own company. Now I have too many jobs (marketing, business development, public relations, sales, development, architect, consultant, etc.) but I don't think I will ever go back to cube-land.