UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9FehXsd6b8xnH6Ps+xLZv225jGnbRpybCFMyOjVXLIA='
WHERE
key_id = 'a5f23e6c03a112eda03a3e57c42afe4794ca6c8a6884673f62acd8f320cb6d52'
AND (
token = '9FehXsd6b8xnH6Ps+xLZv225jGnbRpybCFMyOjVXLIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)