@Tammy *************
you have to do it where your TM30 is registered. So if you're on Koh Lipe in a hotel then they should do a TM30 for you, as required by law, then you can extend there if there's an immigration office there anyway.
You also don't have to do it on the last day. If you have less than 30 days left on your stay then you can do it now and the days will be added on to your current expiry date.