Select * from table where created_at >= {created_at} and id <> {id} order by created_at, id asc limit 1
Select * from table where created_at <= {created_at} and id <> {id} order by created_at, id desc limit 1
{created_at} и {id} замените значениями текущего поля