What do I do?
It's never too late to accomplish great things. Age has little to no correlation to accomplishment and many individuals have made great contributions in their later years. Comparing yourself to others only serves to inhibit what you, yourself can contribute.
Having a negative view of past work efforts denies the fact that everything you do has some benefit from having done something, whether successful or not. Even failures inform us of what does not work and suggest we try again to find out what does. It's relatively easy to look back and evaluate what you have done against others, only to be disappointed that your achievements or lack thereof, do not meet some artificial standard of accomplishment.
The key to motivating yourself is to find something you are truly passionate about. The reward is the intrinsic quality of the work being done itself. When you find something that you can fully engage in and that has intrinsic value and meaning to you, that is when you feel a sense of achievement. Also, value comes from the journey itself and not necessarily the end product. If you learn a new skill, develop competencies and proficiencies along the way, that in itself is an accomplishment to take pride in.
Feeling like you are stuck in a rut comes from not being challenged. If you are in a boring job, have repetitive tasks that are routine, so much so, that a machine could do it, then you are not feeling valued and it can result in you feeling bored, unappreciated, and wasting your time. If you are asked to do assignments that involve some level of personal involvement, or are creative, or challenging, it is easier to become more involved and absorbed by the opportunity to make a unique contribution to producing something. Also, if you find what you are working on is not worthwhile, from the standpoint of usefulness or value, then you are probably not feeling like you have made a contribution. and you can just chalk up your efforts toward being a learning experience you might not want to repeat in the future.
The point is, ruts are created by not being challenged. Motivation comes from being put to the test and finding both intrinsic and extrinsic value in what you do or produce. Avoiding ruts and feeling a sense of accomplishment and self-worth comes from finding something you are passionate about and then pursuing that something as a challenge to conquer. It's never too late to make that happen and to derive a sense of satisfaction for a job well done.