I don't recall such refined control over grid instances at the query level itself being possible OOTB.
What factor determines whether or not an instance should be editable inline?
If you want to control it at the query level you could make only the attribute which requires updating editable. This would apply to all instances but you could have a clean-up rule which deletes anything erroneously entered in that attribute of instances which should not have been edited, based on the value of another attribute.
Or, you might have to settle for no instances being editable inline and an 'EDIT' button which appears conditionally for an instance based on the value of an attribute of the instance, which leads to a popup to enter the value needed.