UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FtnSRNGF6D8+wh3SKBo9SLLgCZKJvI9InkLPQOzZ9kc=' 
WHERE 
  key_id = 'c520d342ef347f07e6b7599b050ea66c44b95da4dc97b877416a2f0bb037e5df' 
  AND (
    token = 'FtnSRNGF6D8+wh3SKBo9SLLgCZKJvI9InkLPQOzZ9kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031