UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mwKicT1hICM2INxmZJ/Lzmwj6lakXRJ8eR/D7Lvgkmo=' 
WHERE 
  key_id = '7a12c13f8574f4458f4d3f36fc39ecd537a83f15258dd2151998ad88505e4cdd' 
  AND (
    token = 'mwKicT1hICM2INxmZJ/Lzmwj6lakXRJ8eR/D7Lvgkmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041