UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'huXXOpfi451VVHKX/jU4Q6Qn5eKZrmGlaFfzuF+QfyE='
WHERE
key_id = '6595c21523336f8c9bf9ed20ecb5b2e41a1ba637de42f8878d974277b65f6785'
AND (
token = 'huXXOpfi451VVHKX/jU4Q6Qn5eKZrmGlaFfzuF+QfyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)