UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FXHc76pN6VJkntqyBZIibMAak0wkS7y66LKY4cSImaM='
WHERE
key_id = '6b30c2c68c075f3257e84adc7b4fea3d7b5672e59dae2fc9fb2fb623422bb559'
AND (
token = 'FXHc76pN6VJkntqyBZIibMAak0wkS7y66LKY4cSImaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)