The only time I say that is when I run in to an old friend that apparently wasn't a good enough friend to return my occasional phone call or hang out once in a while and I'm trying to sound like I sincerely care enough about them that the time I just wasted shooting the bull was worth it. I say it to the people who dropped off the face of the Earth to me and think that I should still care about them enough to hear about who they married or how many kids they have while I'm trying to make a quick trip to the store to buy some milk or something when I know the next time I hear from them it won't be until I bump in to them again.
I feel that reserving it for these specific situations fits quite nicely as a mildly-veiled bitter remark designed to make them understand that I don't care but not until I'm long gone. It's an obvious poke at the fact that I told them to keep in touch, but it's been so long that they don't have current contact information and I didn't give it to them, either.
So to sum it up, it's pretty much translates to "If you ever decide to give a shit about our friendship then the ball is in your court."
If you stop me when I'm out and about somewhere and try to catch up on months... years... of your life, expect that I will tell you to "keep in touch."