Update the update() method to use prepared statements