You could use their email address as the ID so that if the same email address is used it updates the record instead of inserting a new one. Or just use an insert into table instead of store cart summary into database if you want to insert a new record every time.