For past dates: =a1<=TODAY()
For upcoming dates: =a1<=TODAY()+30
Put them in the order shown. This will work in pretty much any version of Excel. However, if you have 2007 or newer, there are also alternate ways to do this.
To use these formulas in Excel 2007, the steps would be:
Home tab, Conditional Formatting
New rule
Use a formula to determine which cells to format