UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZbhSPA6TSQ4uVnpgtVnp6LQHQNXS97k7MdlYK+DBpak=' 
WHERE 
  key_id = '88d449bdd35bcdf88dbfbdf926cc924516c314cb61b20a826b278eb782c1bc05' 
  AND (
    token = 'ZbhSPA6TSQ4uVnpgtVnp6LQHQNXS97k7MdlYK+DBpak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019