When you have sunscreen that is past it's 'use by' date, you should not use it to protect your skin from the sun. It could possibly be useful as a lotion, if you are certain there is no bacteria present.
A manager at a CVS drugstore told me that the sales are recycled every 3 weeks, so if what you want isn't on sale and you can wait to stock up, be aware that this is a possibility and may also be true of other stores. This may no longer be practiced, but it was true as of a few months ago.