Apply the off-policy Q-learning update using the maximum next-state action value and terminal handling.