I am sorry to hear that you are having this knee pain, and congratulations on staying physically fit and active! The fact that the pain is irregular and does not occur all the time is encouraging, in that this mean that you probably do not have a serious nerve problem.
Nerve pain coming from a pinched nerve or other problem in the spine is typically more or a numbness
or tingling or radiating pain, rather than simply pain localized to the knee like you are describing. However if you do begin to experience symptoms like this or if you have any weakness of the muscles in the leg, you should see your doctor
It seems more likely that what you are dealing with is arthritis
if the knee. You are the right age to begin to have problems with this. The pain does tend to come and go in an unpredictable fashion, although it does tend to worsen with age. Simple treatments for this age related arthritis, called osteoarthritis, include simple antiinflammatory medicines like ibuprofen, knee bracing, rest, and ice. In more advanced cases, you may want to consider injections of steroids into the joint and, finally, definite joint replacement surgery, but it does not seem like you are to that point yet.