mysql> SELECT tab1.`id` FROM `image` AS tab1 JOIN (SELECT ( RAND() * (SELECT MAX(id) FROM `image`) ) AS id ) AS tab2 WHERE tab1.id >= tab2.id ORDER BY tab1.id ASC LIMIT 1;
+---------+
| id |
+---------+
| 3570920 |
+---------+
1 row in set (0.01 sec)
mysql> select id from image order by rand() limit 1 \G
*************************** 1. row ***************************
id: 1325603
1 row in set (1 min 3.43 sec)