UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VQWpiEz692xLuwAEYKlbeCkviWEs5ShQ731Lj7zQ4OU='
WHERE
key_id = '0681f20bcfa2833a00c0b255741336703467a61ada8cc6c58540b2cc998b5c2f'
AND (
token = 'VQWpiEz692xLuwAEYKlbeCkviWEs5ShQ731Lj7zQ4OU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)