INSERT INTO .... ON DUPLICATE UPDATE ...
That's to prevent duplicate entries. Instead of duplicating it, you'd use the Update syntax to update whatever has changed.
If you're tracking users, you should not necessarily track by timestamp, rather Session ID or even DB ID for that session ID. This way, you can select a UNIQUE ID / Session identifier. If it's in the table, update it, if not, insert it.