You could build your query in multiple steps - anyway it gets executed after calling .Execute()
method.
This means you could do it like that:
var query = new DataQuery("store.member.allMembers")
.Columns("store_member.firstName", "store_member.lastName", "store_member.emailAddress", "store_member.displayName")
.Where("store_member.firstName", QueryOperator.Equals, firstName);
if(!String.IsNullOrEmpty(lastName)){
query = query.Where("store_member.lastName", QueryOperator.Equals, lastName);
}
DataSet memberResults = query.Execute();