SELECT * FROM emails WHERE status=0 order by rand() limit 1
UPDATE emails SET status='1' WHERE id=5111
UPDATE `emails` SET `status` = 1 WHERE @id := `id` AND `status` = 0 ORDER BY RAND() LIMIT 1;
SELECT * FROM `emails` WHERE `id` = @id;
UPDATE emails SET status='1' WHERE id=(SELECT id FROM emails WHERE status=0 order by rand() limit 1)