For any field in a MySQL table, you have 3 options for field constraints:

PRIMARY, INDEX, and UNIQUE

In your case, just use the UNIQUE constraint and MySQL will generate a standard error if you try to insert a duplicate record. If you want, from there you can handle it with your server-side programming to generate the appropriate 'retry' message.