UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f3XqZ7SdHe2A0s8fUGbQH/eHohINEKHpTFlJssYzQX4='
WHERE
key_id = 'a2d234954366be0ba6d4fcbbe0c5cc39db978ed762ea3aca4853a815b0999189'
AND (
token = 'f3XqZ7SdHe2A0s8fUGbQH/eHohINEKHpTFlJssYzQX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)