Ci sono molti modi per farlo con due query in un linguaggio di programmazione, ma ecco un modo per farlo in un'unica query SQL:
(SELECT * FROM table WHERE id >= 34 AND active = 1 ORDER BY id ASC LIMIT 6)
UNION
(SELECT * FROM table WHERE id < 34 AND active = 1 ORDER BY id DESC LIMIT 5)
ORDER BY id ASC
Questo restituirebbe le 5 righe precedenti, la riga di destinazione e le 5 righe successive.