UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ktnm+XOQvGJCfCZoXAQwJrfelRxr6cklaI7uJoZLi7w='
WHERE
key_id = '24ebcb0aab295acae175cc675368c9a682494ec9b0dca9faf68e79ac5b1b56ca'
AND (
token = 'ktnm+XOQvGJCfCZoXAQwJrfelRxr6cklaI7uJoZLi7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)