UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wSACF2R4vDy8uqvCb4xuyNPHKttar3EHSaz7ZjXVKJw='
WHERE
key_id = '23ce59c0f793cd9154ac46358d57bb00a832378f417e617966d7ee5a6764ae8f'
AND (
token = 'wSACF2R4vDy8uqvCb4xuyNPHKttar3EHSaz7ZjXVKJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)