fixing sql due to server mysql 5.5 timestamp limitation