UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bZ89enDaSSS8PBZSyaIdZDFrpAST1CD5Rl45D8/ahJw=' 
WHERE 
  key_id = '861ac6fe1e4b2f25f20a2f8c04f50a31354189596324e8e28cf826d3b36f9214' 
  AND (
    token = 'bZ89enDaSSS8PBZSyaIdZDFrpAST1CD5Rl45D8/ahJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029