UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r748jVkfYlXzSfBS2silguq9eAviNy7mXMEOGyZtL7o=' 
WHERE 
  key_id = '95d1f1ffe6f9df2318ec07adb9f8ef15b5b4f139fd9c813760562f201ecc1996' 
  AND (
    token = 'r748jVkfYlXzSfBS2silguq9eAviNy7mXMEOGyZtL7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024