@Sue *****
then you can apply for an extension when you have 45 days or less left on your current stamp <- which means seeing as you arrived on a visa exempt entry and were stamped in for only 30 days you can go to the Chiang Mai immigration office ANY time to apply for the 30 day extension.
There is no up side to waiting until the last date as the extension is ADDED to your current expiration date (meaning you don't lose any days going early) :P ;)