Chiang Mai allows you to apply for an extension of stay when you have 45 days or less left on your current admitted until stamp. Seeing as the O/P got a 30 day exempt stamp he could go to the Chiang Mai immigration office ANY time and get the 30 day extension. They add the 30 days to your current expiration date so there is no down side to going early,
@Rob***
, is correct though, some immigration offices want you to apply closer to the actual expiration date. But Chiang Mai isn't one of them .