UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YeaK6pOA8+0gdhdKwIaLaNF9A80C3ai3G3m5/M8YzMc='
WHERE
key_id = 'f6edcec95274e364cf15d3377d5c92831d59bf7dfa4020b29e3fcd595249aba8'
AND (
token = 'YeaK6pOA8+0gdhdKwIaLaNF9A80C3ai3G3m5/M8YzMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)