I\'m struggling to come up with a logic how to insert a new row to an existing mysql table at the right place based on the timestamp. My primary key in the table is the date