UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sHvJ6uShcAvMyM8Wfo7Cs2JiuwZV0ffUqdQJsbZnmnk='
WHERE
key_id = '422c8362321d8111cd7361ffab17a7701338028dafa5da7c518b912cfacff650'
AND (
token = 'sHvJ6uShcAvMyM8Wfo7Cs2JiuwZV0ffUqdQJsbZnmnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)