Dear XXXXXXXX,
Your financial situation is not as grave as your believe, but at the same time, you are correct that you need to plan for your retirement income.
You can, therefore, go ahead in retiring the$22,000 mortgage from the proceeds. This will make the house free and with 100% equity. Also, by doing this, you shall save considerable amount towards interest cost.
You can always explore the equity in your home later when you need finance later and therefore, you should certainly payoff your mortgage. And so far as your retirement planning goes, you can start planning by using the remaining ($50000 - $22000 - which are used to pay off mortgage) funds in your retirement accounts and continue contributing every month.
I hope the above helps...
Regards,
Financial Advisor
Technical Analyst in Financial Markets -- Experience of more than 10 years in consulting