UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PK+6tJh77Zz8GycUhg5VizPh25RW19ulL3FC9v54abM=' 
WHERE 
  key_id = '1804adddb55f0fd951046d9c45336f44ecfb43b6dac94ae9a7dfbd3cdcb7feac' 
  AND (
    token = 'PK+6tJh77Zz8GycUhg5VizPh25RW19ulL3FC9v54abM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067