UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yC/o58oqRWJSvdAXK0uDWItd6QjWQ4cq2iQZTTDMp2c='
WHERE
key_id = 'c92a80d19bf3f463604d778a865d8a6f1c558d1b0ee903fa7cec80bc90478d80'
AND (
token = 'yC/o58oqRWJSvdAXK0uDWItd6QjWQ4cq2iQZTTDMp2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)