It looks similar, but you have fewer subqueries.
SELECT * FROM members m WHERE EXIST (SELECT f.followingid FROM follows f WHERE f.memberid = '$memberid' AND f.followingid = m.memberid) AND NOT EXIST (SELECT u.blockmemberid FROM userblock u WHERE (m.memberid = '$memberid' AND u.blockmemberid = m.memberid) OR (u.blockmemberid = m.memberid AND u.memberid = m.memberid) )
This is the logic that I turned over, created from your code without looking at tables.
source share