Approach 1: You can use query expressions, and put this in an AOT query's init() method. You have to execute the query via Code, and explicitly call the query.init() method, before Looping.
This will not work if the query is accessed without Code (eg: View, form, etc..)
Approach2: Make 2 different queries: one with the part before the OR, another for the one after. Even in this case, for curUserId() you will Need init() method.
Without curUserId(), you can simply do with 2 different queries, whicl will get you data for all users. You can filter based on curUserId() in your form or Code..