How can I handle cases where a group of rows have the same identifier in mysql?
You need to create a separate key, unrelated to the timestamp, when inserting the rows into a table. MySQL has a handy auto increment feature for this purpose.