UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S0m7rHAdlOw9mGOV2N5ozJUTM/S+rRXPin4DtGgfGqU=' 
WHERE 
  key_id = '32d25a6a9db6a8a69ac84c21b03690c309f71b85fd2f68204d5eff8fec25632f' 
  AND (
    token = 'S0m7rHAdlOw9mGOV2N5ozJUTM/S+rRXPin4DtGgfGqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041