MySQL provides a more readable way to combine multiple updates into a single query. This seems to be better suited to the scenario you are describing, much easier to read, and avoids multiple conditions difficult to unravel.
INSERT INTO table_users (cod_user, date, user_rol, cod_office) VALUES ('622057', '12082014', 'student', '123456'), ('2913659', '12082014', 'assistant','123456'), ('6160230', '12082014', 'admin', '123456') ON DUPLICATE KEY UPDATE cod_user=VALUES(cod_user), date=VALUES(date)
It is assumed that the combination user_rol, cod_office is the primary key. If only one of them is PK, add another field to the UPDATE list. If none of them is the primary key (which seems unlikely), then this approach will always create new records - perhaps not what you need.
However, this approach simplifies the collection and simplification of prepared instructions.
John Trevithick Jan 19 '16 at 0:13 2016-01-19 00:13
source share