UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/uowqCumKea6RBQGFS5NVWKxBa2OqnRb/xCAsf11HAg='
WHERE
key_id = 'd3806c385d5bb338a08fb8ec023c7fc43ad15b620663a79b07b430f22f09d275'
AND (
token = '/uowqCumKea6RBQGFS5NVWKxBa2OqnRb/xCAsf11HAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)