UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vxjQyVCG1i988d/c/u3mFXZ5XvDK8JLf6bVCJ4w/r9A=' 
WHERE 
  key_id = '68bc4fa6efb94ed315b6654e2033f36013c40df91e4ac84e22d8ab71a6dc7ad4' 
  AND (
    token = 'vxjQyVCG1i988d/c/u3mFXZ5XvDK8JLf6bVCJ4w/r9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037