random_code must be unique, this is forced in the database
Prevented the insertion of a duplicated sesame code.
When this happens the script will generated another code until it is successfully stored or the maximum num of tries is passed.