SQL for new if-modified-since-feature