Generate new GUID, if not found, and save into database.