Because something isn't working correctly.
I was referring to the general idea. If you have to check if a record with the same data has not been added at the same time, then something is not working as it should.
If you really have to do this (for whatever reason), you should probably add a unique index to fields (user_id+created_at).