Du kan gøre sådan noget:
For næste id,
SELECT id from tablename where username = 'user1' AND id > $currentId ORDER BY ID ASC LIMIT 1;
For tidligere id,
SELECT id from tablename where username = 'user1' AND id < $currentId ORDER BY ID DESC LIMIT 1;