UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TH7/tIGBXVIOnA1DKU76D0yTTcKLJwGwmU8ZP8P6cOg='
WHERE
key_id = '33210d517a0d43176c3c386e3f5397d24300338f5154fd8ff7bea0d6a2fcec12'
AND (
token = 'TH7/tIGBXVIOnA1DKU76D0yTTcKLJwGwmU8ZP8P6cOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)