Basically, you want to do the update. That would be
UPDATE some_table SET column = some_value WHERE condition;
Can you include those queries into the 'condition'? Perhaps you could, but I guess it would be a
giant condition having two queries, every containing multiple joins. Poor you if you try to put them together and poor everyone who'd try to debug this
I'd, somehow, prefer doing this using procedural options your DB engine provides. If it was Oracle, I'd use PL/SQL procedure with a cursor loop (for your B query) and then - for every row it returns - check existence of a matching row returned by the A query and do the required update.
Perhaps it is even possible to "join" those queries using EXISTS clause Oracle provides and do the job in the "condition" mentioned above ...
Well, those were some thoughts. You'll surely hear some more and decide what's the best approach for your problem.