Okay, assuming you have users A and B, you should just be able to do this:
Order.where(user: A, target: B)
...assuming you've defined your associations, otherwise:
Order.where(user_id: A.id, target_id: B.id)
EDIT: just saw your comment. You could add .first to either of the above queries just to get the first order if you wanted to.
ANOTHER EDIT: As I understand it, if there's ever been one or more orders between A and B (or B and A), you want to grab one of them, and you don't care which. You could do this:
(Order.where(user: A, target: B) + Order.where(user: B, target: A)).first
That will give you a record if one exists and nil if it doesn't. Raw SQL would be more efficient:
Order.where("user_id = ? AND target_id = ? OR user_id = ? AND target_id = ?", A.id, B.id, B.id, A.id).first
... but less readable, and be sure to test it. Good luck!