UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EQQERvYYSQkLO9Z1EK5e4lFX1mOXgQGpBgwIdOlNrmg=' 
WHERE 
  key_id = '3bd78421a3897f21c1a8ccfde663e69dbfec9c0a4fd67504b85ddb21314cb174' 
  AND (
    token = 'EQQERvYYSQkLO9Z1EK5e4lFX1mOXgQGpBgwIdOlNrmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020