UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SPfzlO4ytfW/6Vq8XXMu9eDvhMM+0BQl4mXG73TVDhg=' 
WHERE 
  key_id = 'cfe5cd7449fd439e1c87507d8e465ba495c1fa02ad88b86d0b0b1ea62971dc58' 
  AND (
    token = 'SPfzlO4ytfW/6Vq8XXMu9eDvhMM+0BQl4mXG73TVDhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041