UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OlhMl/R7hM2oZ+aIjyVJkZLPP0VoJLZuFOyWt9Zsq8g='
WHERE
key_id = 'b0cef36c3f3c6710129952e394f1828daa6a75c97b138ebc3a3ad122c7de2876'
AND (
token = 'OlhMl/R7hM2oZ+aIjyVJkZLPP0VoJLZuFOyWt9Zsq8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)