Postgres 11 - *prioritized* where clause in group
Booleans can be ORDERED BY just like other types, with false coming before true when no direction is given.

You could use this in a DISTINCT ON, or in a LATERAL join.

SELECT DISTINCT ON (identity), * 
from cafes 
ORDER BY identity, is_closed DESC NULLS last
       , is_illegal DESC NULLS last