You can go to immigration and pay to extend for 30 days. After that you can just fly to baharain or Dubai and come back the same day.