UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '97VAMmcObD3P+X0SkItJcJp7usJN8WyREsf8/DwhkSA=' 
WHERE 
  key_id = '86d18a53a401e5caba1ff43ea99bfbf5970c66775b27106e43d492e52028eff3' 
  AND (
    token = '97VAMmcObD3P+X0SkItJcJp7usJN8WyREsf8/DwhkSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031