I recently turned 50. I am a fitness junkie, and retired fitness professional (now consulting).
Sounds like a situation to see someone to find out exactly what is going on.
Once you know more about the current situation you can make an action plan that may or may not involve a knee replacement.
Have you looked at your sitting position or considered a standing desk?