Considering the age and symptoms it's likely to be degenerative changes of the knee joint. Painkillers mask the pain and the condition usually worsens over a period of time. The weakness of the thigh muscles is the primary cause which prevents active locking (locking = knee straightening by pure muscle strength). This leads to passive locking (passive locking by twisting of femur and tibia) of knee and the soft cartilages inside the joint gets compressed and erodes. An x-ray can reveal the status and based on it a short term and long term plan will be advised by your Physiotherapist. Biomechanical offloading braces may be required if there is too much collapse of joint compartments. This might even save your knee from a replacement surgery.
Next Steps
ice packs can help in acute conditions.
Health Tips
avoid walking on uneven surfaces and climbing stairs.