Sure, it can be done. Every time the page must rotate, it will change a file that stores the information:
last_time_changed
time_change (10 or 30)
Every time someone visits the page, it checks whether or not last_time_changed + time_change <= date("s"). If it is, then we rotate and update. If not, then we don't.