Go to an emergency room. The most likely etiology is fluid build-up, which they will extract with a hypodermic syringe (a ten minute procedure) in the ER and you will then have no pain and leave a happy camper.. These build-ups often occur without any specific incident, and after the fluid is removed don't return. Mystery problems. It could be a torn miniscus, but the gradual onset suggests sinple fluid. When the fluid is extracted they will look for evicence of blood. The procedure is relatively painless, but look away because the large needle is psychologically a nightmare.
If it was due to your new mattress, I would have thought that both knees would be affected.
It could be a ligament or cartilage problem or displacement of the knee cap or even arthritis. There are other medical conditions that can cause knee pain. Do you suffer from gout at all, is the knee inflamed and red or just painful?
I would advise you see your doctor for a proper diagnosis. Your doctor may refer you for xray.
I have osteoarthritis in both knees, but my right knee is the worst.
All the best