How to Perform Two Simple Queries using Select Value from First Query
How about using a join in the unioned SELECTs:

(SELECT a.* 
 FROM table AS a
  JOIN table AS t2 ON (a.id &lt; t2.id)
 WHERE t2.column_b = 'a value'
 ORDER BY id DESC LIMIT 5) 
UNION ALL
(SELECT a.*
 FROM table AS a
  JOIN table AS t2 ON (a.id &gt;= t2.id)
 WHERE t2.column_b = 'a value'
 ORDER BY id ASC LIMIT 15)


Note that the order from the parts of UNION ALL might not be preserved in the result.