Refinancing your mortgage may seem pretty tempting right now with interest rates near record lows. I know some folks who just refinanced a year ago who are thinking about doing it again just to lock in these low rates. Plus, wouldn't you just love to have some extra cash around or pay down some credit card or student loan debt?

It all sounds good until you realize that there's more to consider than just a lower rate, especially if you are over 50. It's never been wise to still have a mortgage if you've retired. In fact, you want to be as debt-free as possible when living on a fixed income such as a pension or Social Security.

Today, however, things are a little different. More new retirees have mortgage debt. In fact according to the Society of Actuaries, about half of retirees say they carried mortgage debt in 2009. And that trend is likely to continue as baby boomers enter retirement age.

With the interest rate for a 30-year mortgage hovering just above 4%, the temptation to refinance is strong. The Mortgage Bankers Association says refinancing applications make up about 82% of total mortgage loan applications compared to 55% back in April. The payoff is hundreds of dollars in "savings" each month. A $200,000 mortgage balance at 6.5% refinanced to 4.5% could cut monthly payments by $200 or more.

Still, even at such low rates, financial advisors recommend that it may not be the right move if you are over 50 or let's say an older boomer in spitting distance of retirement. Granted, more and more boomers are saying they intend to keep working, which is fine provided they can remain employed. But what if you're forced into retirement at age 66, and you still have a recently refinanced 30 year mortgage to pay off?

Consider this

So here's the deal. If you're determined to refinance or are thinking hard about refinancing and you're nearing retirement, here are some things you need to consider.

If you're thinking about using the extra money you save from refinancing to invest in the stock market, don't. Over the long-term the stock market has historically generated high returns and the average annual gain of the S&P 500 from 1926 to 2010 was 9.8%. Do you have another 80 years to get those average returns? No. The last ten years have been a wash. You made zip in the stock market. So if you're less than 10 years from retirement, don't use that extra monthly savings from refinancing to invest in stocks. Instead, pay down your mortgage or other loans as quickly as you can. You'll get a much better return.

Do you plan on staying in your house at least three more years which is just long enough to recoup the closing costs? If not, don't refinance. However, if you're thinking maybe you'll move in five or six years to a smaller less expensive home in retirement, and your finances are in fairly good shape, meaning not much other debt, then refinancing could help you buy that retirement home while you still have a job. It may be harder to finance a mortgage once you retire because your income is considered to be irregular. Also prices in many popular retirement areas are still depressed, so this might be a good time to score a deal on a home. You could even rent out one of the homes to help pay for the extra mortgage.

Some people over 50 who are thinking about refinancing may justify the move by saying they plant to work longer. In fact, 75% of workers aged 50 and older expect to have jobs when they are retired, according to a 2010 study by the Families and Work Institute and the Sloan Center on Aging & Work. Now that  might make extending your mortgage into retirement seem fine, but getting a job over the age 65 isn't a guarantee. Plus, you could get sick or become incapacitated for any number of age-related reasons. The unemployment rate for workers ages 55 and older has remained at a record high since December 2009 and for those 65 and older the rate is even higher, nearly double what it was just five years ago.

If you really need the cash now, refinancing may be the right thing to do. Savings aren't earning much interest and a one-year CD is yielding a mere 1%. Essential expenses like health care are rising and more people are strapped for cash. If refinancing lowers your monthly payments even as it extends the term of your loan, it might still be worth it.

If you're over 50, try to get a 15-year mortgage when you refinance. It will leave more money in your pocket because you'll pay much less in interest over the life of the loan. Plus, interest rates tend to be lower on 15 year mortgages. It just means a higher monthly payment.