Exactly. As a counterexample, I'm approaching 40 in the best physical and mental shape of my life. You simply have to take responsibility for your own health, especially if your job involves sitting on your ass for extended hours every day.
If I hadn't kept fitness and eating healthy as a priority for the last 15 years, my health would've been in complete shambles by now. I was pretty lazy and self-destructive through my early adolescence, and in my early twenties I was in terrible shape physically and had a lot of severe mental problems that I no longer struggle with. I'm extremely grateful to my 22-year old self that decided to try and turn things around, it didn't happen overnight.