a jednak się da w jednym zapytaniu :)
UPDATE nodes n1,(
SELECT
n.id FROM nodes n
LEFT JOIN nodeassignments ON
n.id = nodeassignments.nodeid
LEFT JOIN assignments ON nodeassignments.assignmentid=
assignments.id WHERE (assignments.dateto > unix_timestamp() or assignments.dateto='0' )
AND assignments.datefrom < unix_timestamp()
AND assignments.suspended = 0
AND access = '0'
AND (SELECT SUM(value) FROM cash WHERE customerid = n.ownerid) >= 0
) AS n2
SET n1.access=1, n1.warning=0
WHERE
n1.id =
n2.id i to mi wyłapuje jak narazie dobrze :)