UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oui+b5mqsRy+Y+YIafnPk9eLkhBf5ZW/jtXxt6PQAjg=' 
WHERE 
  key_id = '13192387b5fc9f3ff96d66cd56df8059c9ef3ca4e3a236bc3a036adc3cd7cd28' 
  AND (
    token = 'oui+b5mqsRy+Y+YIafnPk9eLkhBf5ZW/jtXxt6PQAjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027