UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'inkfFOhMKHaxQgocFB+ZRkpmGIR0I1aG+xEaQS0PdOw='
WHERE
key_id = 'fb1743be84a60be349815c210516706fc8ff594106ac3848b6ca4ce6d0fb5ae0'
AND (
token = 'inkfFOhMKHaxQgocFB+ZRkpmGIR0I1aG+xEaQS0PdOw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)