At the risk of stating the obvious, why would you do lunges to begin with? Are you going to deep? Your knee is telling you to back off. There are plenty of exercises you can do to work the same muscles without doing lunges - I have had multiple knee surgeries and gave up lunges 30 years ago.