UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+6J1SUv2tH50T5LtumRgJkU6/9vg3z2YJDUMjUtcKsA='
WHERE
key_id = 'b2e401a6f69f21506346a6c5e39c47fc9a26b4c0ae967e6cd717a40c6c2354dd'
AND (
token = '+6J1SUv2tH50T5LtumRgJkU6/9vg3z2YJDUMjUtcKsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)