On the optimal control of random walks with jumps and barrier