Fix SQL Query to correctly fetch last 30 minutes and not seconds