UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IpAiUfRaERGa9lpweq9Ibc6QY+UO/LBpRe6I2w936Zs='
WHERE
key_id = '5e0d446ba3cc301dfe420f37cba310b7455d32b2069fae9f669a29b5407cf91f'
AND (
token = 'IpAiUfRaERGa9lpweq9Ibc6QY+UO/LBpRe6I2w936Zs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)