I'm 50 and still pitching in Denver's MSBL 35+ league. I've had shoulder surgery, slid the pronator muscle off the inside of my pitching elbow, just had surgery 3 weeks ago, for a sports hernia, groin pulls etc. etc, and I still can't give it up.
While I've lost velocity over the years, ( now throwing 77-81) I've gained movement and command. I've learned how my body recovers from pitching at altitude and how to take care of my arm and legs better.
So yes. You can keep pitching for a long time. It just takes a lot more effort to take care of yourself at 50 vs 20.