I was in a very similar position for three years. I counted my blessings in terms of flexibility, and I tried to find new projects/skills to develop within the scope of my job. Basically, I used the time to improve my resume so that I could find a better job.
And when my old job got unbearable, I started looking, and found something else, that paid market value, and was just as flexible.