It sounds like you are fairly active, that is great, I wish I would here that from more people.
Sit down jobs pretty commonly will tighten certain muscles, especially biceps femoris, semitendenousus mucscle (posterior of upper leg), and certain hip and lower back muscles. I learned this from a yoga instructing course (rather than nursing courses) but also then from observing yoga students as they come into classes and also from noticing patients after learning more about the muscles and tendons from the yoga perspective.
Stretching the muscles is very much neglected in most exercise regimens. We may do a few to "warm up" but generally don't do enough to counter-act 8 hours of sitting in a position where certain muscles are in a prolonged shortened position. Also, there are muscles, refered to as "core" muscles that are often neglected in "regular' exercise, as typical exercise routines often focus on muscles that are visible, or that produce a particular strength, rather than the core muscles of the body that help with balance and that do not show visibly the results of a work out.
Also, if you havent' been doing a lot of squats, this may be a factor too, as some of these muscles may be fairly strong from other excercises, but not exactly in the area's needed for squating. Squatting exercises generally are not easy if you haven't been doing them regulary.
It would really help to observe you to validate this, but, also as a yoga teacher might suggest, start paying more attention to the particular muscles and tendons when this occurs to distinguish what is going on.
But what I think may be occurring is that some muscles are overly weak or shortened, while others are strong.
My suggestion would be to integrate some squats into your regular routing, but also to focus more on stretching exercises. There are great examples of yoga for hips and legs online, as well as full courses. I personally believe learning complete yoga routines that stretch all the muscles are best, XXXXX XXXXX way your whole body becomes more equally balanced and stretched, as well as strengthened, and this helps with a lot of things such as preventing sport injuries, neck problems, lower back problems, etc., that often become almost expected as we age.
I noticed your history of anxiety, so I thought I'd mention how with yoga you learn to inhale as you flex muscles, and exhale as you release the muscle. This helps the muslce to stretch, but also decreases anxiety.
If you decided to take a yoga class, be sure to start with the type that is called "beginners" or "gentle" yoga. If you don't like the idea of yoga (it is not a religion as some people fear) you may prefer a pilates class which also includes strengtening of course muscles and stretching, but less focus on learning how to relax as well.
Of course, if this problem increases or does not relieve, you may want to see an orthopedist for examination and diagnosis. A physical therapist would likely be able to help with diagnosis, as long as the problem is indeed structurally related.
I hope this helps. If you have questions or comments, please reply.