UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9UE3I21Hmzv9VvGMKxtCfJEDhaAqWQb+WVDg03+76/w='
WHERE
key_id = '9991e0531edef7d736eba0043b73b92bb3233461d559bd7391058895ca535167'
AND (
token = '9UE3I21Hmzv9VvGMKxtCfJEDhaAqWQb+WVDg03+76/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)