I've hit mid-40s and I'm still a happy individual contributor. So you aren't necessarily doomed to a management role, and you shouldn't rush into it if that's not what you want.
I've always told myself that I'll code until I can't keep up. So far that hasn't happened. Once it does, I will happily transition to more of a management role to be of the greatest value that I can. Along the way (and even now), though, I've had a good number of management-like responsibilities which will help a lot. So, I encourage you to take advantage of those opportunities as they come along. There isn't a bright, hard line between management and individual contribution. There is a space between.
A good manager will look out for your career path and help you get to management, if that's what you want.