update property natural join int_prop natural join entity_property natural join entity
inner join medb_transaction on entity.eid = medb_transaction.eiddst and entity_property.ron = medb_transaction.ron
and property.prop_group_id = medb_transaction.prop_group_id
set int_val = int_val - qty
where medb_transaction.eidsrc = 8 and property.prop_id = 15
The prop_id 15 is the ID of the 'quantity' property. eidsrc is passed as a parameter to the stored procedure and represents the user id (or "eid" for entity id in myedb speak ;) ).