Let me first say, for answers to legal questions, it is best to consult with an attorney. Based on my experience, if you have a valid and bonafide lease, you may be able to use the Protecting Tenants in Foreclosure Act of 2009. This would allow you to remain in the property for the remainder of the lease or give you 90 (not 30) days to move.
Again, it is best to seek advice from an attorney when dealing with legal matters.
Best of luck.