I'm not yet 40 but for the past few weeks I've been waking up and my ankles have been sore and stiff for the first few steps when I get out of bed, particularly my left ankle. I don't have my feet at a strange angle when I'm asleep or anything. It also happens when I stand up after I've been sitting for a while and there is just a mild general throbbing or soreness otherwise. I'm not overweight and I walk between 1 and 5 miles a day but average about 3 and haven't walked 5 in a few weeks and sometimes I just stay in. I've been doing this for about 20 years and have been wearing the same model of walking shoe for about 10 years. I've been wearing my most recent pair for about 6 months and didn't notice anything out of the usual when I first put them on, and they are only about half way worn. I typically wear them for a year and a half before I get new ones.
The pain runs from the top of my ankle down around the bone on the outer edge.