This is a sort that slows you down. Instead of randomly sorting, select random product_db.unique_id
In your query, replace ORDER BY RAND() with:
AND product_db.unique_id >= ROUND(RAND()*(SELECT MAX(unique_id) FROM product_db))
using >= instead of = if unique_id has been removed from the database. Not as random a result as ranking by rand, but the query will run much faster. If you want, you can run multiple queries with = until the result is found, and can still be quite quick than sorting all of these results.
With an explicit JOIN, this will be:
SELECT product_db.image FROM product_db JOIN product_page ON product_db.unique_id = product_page.product_unique_id WHERE product_page.page_id = 3 AND product_db.status = 'Online' AND product_db.unique_id >= ROUND(RAND()*(SELECT MAX(unique_id) FROM product_db)) LIMIT 1
source share